$(function () {
    $("#login").click(function () {
        var telephone = $("#telephone").val();
        var pwd = $("#pwd").val();
        $.post("login.do", {"telephone": telephone, "pwd": pwd}, function (data) {
            if (data.success) {
                window.location.href = "view/index.html";
            } else {
                alert(data.message);
            }
        }, "json")
    })
    $("#register").click(function () {
        window.location.href = "registered.html";
    })
});